package tinyinventor.compiler;

public class PythonComponent extends Component {

	private String rawCode;
	private String rawDeclarationCode;
	private String rawMainCode;
	
	public PythonComponent(String componentName, String rawCode, String rawDeclarationCode, String rawMainCode) {
		super(componentName);
		this.rawCode = rawCode;
		this.rawDeclarationCode = rawDeclarationCode;
		this.rawMainCode = rawMainCode;
	}

	@Override
	public PythonComponent clone() {
		return new PythonComponent(getName(), rawCode, rawDeclarationCode, rawMainCode);
	}

	@Override
	public String getCode() {
		return substituteVars(rawCode);
	}
	
	public String getDeclarationCode() {
		return substituteVars(rawDeclarationCode);
	}
	
	public String getMainCode() {
		return substituteVars(rawMainCode);
	}
	
	@Override
	public String toString() {
		return "["+getClass().getSimpleName()+" " + getName() + "]";
	}
	
}
